<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>OpenCV: Line Features Tutorial</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../tutorial-utils.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
   &#160;<span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../d3/d81/tutorial_contrib_root.html">Tutorials for contrib modules</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Line Features Tutorial </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>In this tutorial it will be shown how to:</p>
<ul>
<li>use the <em>BinaryDescriptor</em> interface to extract lines and store them in <em>KeyLine</em> objects</li>
<li>use the same interface to compute descriptors for every extracted line</li>
<li>use the <em>BynaryDescriptorMatcher</em> to determine matches among descriptors obtained from different images</li>
</ul>
<h2>Lines extraction and descriptors computation </h2>
<p>In the following snippet of code, it is shown how to detect lines from an image. The LSD extractor is initialized with <em>LSD_REFINE_ADV</em> option; remaining parameters are left to their default values. A mask of ones is used in order to accept all extracted lines, which, at the end, are displayed using random colors for octave 0.</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*M///////////////////////////////////////////////////////////////////////////////////////</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> //  By downloading, copying, installing or using the software you agree to this license.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> //  If you do not agree to this license, do not download, install,</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> //  copy or use the software.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> //                           License Agreement</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> //                For Open Source Computer Vision Library</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> // Copyright (C) 2014, Biagio Montesano, all rights reserved.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> // Third party copyrights are property of their respective owners.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> // Redistribution and use in source and binary forms, with or without modification,</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> // are permitted provided that the following conditions are met:</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> //   * Redistribution&#39;s of source code must retain the above copyright notice,</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> //     this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> //   * Redistribution&#39;s in binary form must reproduce the above copyright notice,</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> //     this list of conditions and the following disclaimer in the documentation</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> //     and/or other materials provided with the distribution.</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> //   * The name of the copyright holders may not be used to endorse or promote products</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> //     derived from this software without specific prior written permission.</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> // This software is provided by the copyright holders and contributors &quot;as is&quot; and</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> // any express or implied warranties, including, but not limited to, the implied</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"> // warranties of merchantability and fitness for a particular purpose are disclaimed.</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment"> // In no event shall the Intel Corporation or contributors be liable for any direct,</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"> // indirect, incidental, special, exemplary, or consequential damages</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment"> // (including, but not limited to, procurement of substitute goods or services;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment"> // loss of use, data, or profits; or business interruption) however caused</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment"> // and on any theory of liability, whether in contract, strict liability,</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment"> // or tort (including negligence or otherwise) arising in any way out of</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment"> // the use of this software, even if advised of the possibility of such damage.</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="comment"> //M*/</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;opencv2/opencv_modules.hpp&gt;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#ifdef HAVE_OPENCV_FEATURES2D</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../df/d4a/line__descriptor_8hpp.html">opencv2/line_descriptor.hpp</a>&gt;</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4e/utility_8hpp.html">opencv2/core/utility.hpp</a>&gt;</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d5/d0d/features2d_8hpp.html">opencv2/features2d.hpp</a>&gt;</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d4/dd5/highgui_8hpp.html">opencv2/highgui.hpp</a>&gt;</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword">using namespace </span><a class="code" href="../../d2/d51/namespacecv_1_1line__descriptor.html">cv::line_descriptor</a>;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="keyword">using namespace </span>std;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* keys =</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;{ <span class="stringliteral">&quot;{@image_path | | Image path }&quot;</span> };</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> help()</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;{</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;\nThis example shows the functionalities of lines extraction &quot;</span> &lt;&lt; <span class="stringliteral">&quot;furnished by BinaryDescriptor class\n&quot;</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;       &lt;&lt; <span class="stringliteral">&quot;Please, run this sample using a command in the form\n&quot;</span> &lt;&lt; <span class="stringliteral">&quot;./example_line_descriptor_lines_extraction &lt;path_to_input_image&gt;&quot;</span> &lt;&lt; endl;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;}</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keywordtype">int</span> main( <span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv )</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;{</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="comment">/* get parameters from comand line */</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <a class="code" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> parser( argc, argv, keys );</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> image_path = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;( 0 );</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <span class="keywordflow">if</span>( image_path.empty() )</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  {</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    help();</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  }</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  <span class="comment">/* load image */</span></div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> imageMat = <a class="code" href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">imread</a>( image_path, 1 );</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  <span class="keywordflow">if</span>( imageMat.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">data</a> == NULL )</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  {</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    std::cout &lt;&lt; <span class="stringliteral">&quot;Error, image could not be loaded. Please, check its path&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;  }</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;  <span class="comment">/* create a random binary mask */</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> mask = <a class="code" href="../../d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09">Mat::ones</a>( imageMat.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a146f8e8dda07d1365a575ab83d9828d1">size</a>(), <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga81df635441b21f532fdace401e04f588">CV_8UC1</a> );</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="comment">/* create a pointer to a BinaryDescriptor object with deafult parameters */</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr&lt;LSDDetector&gt;</a> bd = <a class="code" href="../../d1/dbd/classcv_1_1line__descriptor_1_1LSDDetector.html#a8de4c87977c2d3fa54b765df532cbf96">LSDDetector::createLSDDetector</a>();</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  <span class="comment">/* create a structure to store extracted lines */</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  vector&lt;KeyLine&gt; lines;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  <span class="comment">/* extract lines */</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> output = imageMat.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#adff2ea98da45eae0833e73582dd4a660">clone</a>();</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  bd-&gt;detect( imageMat, lines, 2, 1, mask );</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  <span class="comment">/* draw lines extracted from octave 0 */</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  <span class="keywordflow">if</span>( output.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#aa11336b9ac538e0475d840657ce164be">channels</a>() == 1 )</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <a class="code" href="../../d8/d01/group__imgproc__color__conversions.html#ga397ae87e1288a81d2363b61574eb8cab">cvtColor</a>( output, output, <a class="code" href="../../d8/d01/group__imgproc__color__conversions.html#gga4e0972be5de079fed4e3a10e24ef5ef0a869da65c045477f2f17d39395df65b2d">COLOR_GRAY2BGR</a> );</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">size_t</span> i = 0; i &lt; lines.size(); i++ )</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  {</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <a class="code" href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html">KeyLine</a> kl = lines[i];</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordflow">if</span>( kl.<a class="code" href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#acd62d95914b8005ee4f425c171c2ed1f">octave</a> == 0)</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    {</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;      <span class="comment">/* get a random color */</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;      <span class="keywordtype">int</span> R = ( rand() % (int) ( 255 + 1 ) );</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;      <span class="keywordtype">int</span> G = ( rand() % (int) ( 255 + 1 ) );</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;      <span class="keywordtype">int</span> B = ( rand() % (int) ( 255 + 1 ) );</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;      <span class="comment">/* get extremes of line */</span></div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;      <a class="code" href="../../db/d4e/classcv_1_1Point__.html">Point</a> pt1 = <a class="code" href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">Point2f</a>( kl.<a class="code" href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#a300d7487fced03e0f781afbad5f6e67d">startPointX</a>, kl.<a class="code" href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#ac36c0fe32df87388d9fa6a8def75f7e4">startPointY</a> );</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;      <a class="code" href="../../db/d4e/classcv_1_1Point__.html">Point</a> pt2 = <a class="code" href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">Point2f</a>( kl.<a class="code" href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#a43b634f8f6b5953f2491b00bf6c231f6">endPointX</a>, kl.<a class="code" href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#a1b528bf3d1f3ab902e279ba1b5a593f1">endPointY</a> );</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;      <span class="comment">/* draw line */</span></div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;      <a class="code" href="../../d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2">line</a>( output, pt1, pt2, <a class="code" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>( B, G, R ), 3 );</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    }</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  }</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;  <span class="comment">/* show lines on image */</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  <a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">imshow</a>( <span class="stringliteral">&quot;LSD lines&quot;</span>, output );</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;  <a class="code" href="../../d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7">waitKey</a>();</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;}</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="keywordtype">int</span> main()</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;{</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    std::cerr &lt;&lt; <span class="stringliteral">&quot;OpenCV was built without features2d module&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;}</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="preprocessor">#endif // HAVE_OPENCV_FEATURES2D</span></div><div class="ttc" id="structcv_1_1line__descriptor_1_1KeyLine_html_a300d7487fced03e0f781afbad5f6e67d"><div class="ttname"><a href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#a300d7487fced03e0f781afbad5f6e67d">cv::line_descriptor::KeyLine::startPointX</a></div><div class="ttdeci">float startPointX</div><div class="ttdef"><b>Definition:</b> descriptor.hpp:126</div></div>
<div class="ttc" id="group__core__basic_html_ga599fe92e910c027be274233eccad7beb"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">cv::Scalar</a></div><div class="ttdeci">Scalar_&lt; double &gt; Scalar</div><div class="ttdef"><b>Definition:</b> types.hpp:669</div></div>
<div class="ttc" id="classcv_1_1line__descriptor_1_1LSDDetector_html_a8de4c87977c2d3fa54b765df532cbf96"><div class="ttname"><a href="../../d1/dbd/classcv_1_1line__descriptor_1_1LSDDetector.html#a8de4c87977c2d3fa54b765df532cbf96">cv::line_descriptor::LSDDetector::createLSDDetector</a></div><div class="ttdeci">static Ptr&lt; LSDDetector &gt; createLSDDetector()</div><div class="ttdoc">Creates ad LSDDetector object, using smart pointers. </div></div>
<div class="ttc" id="group__imgcodecs_html_ga288b8b3da0892bd651fce07b3bbd3a56"><div class="ttname"><a href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">cv::imread</a></div><div class="ttdeci">Mat imread(const String &amp;filename, int flags=IMREAD_COLOR)</div><div class="ttdoc">Loads an image from a file. </div></div>
<div class="ttc" id="classcv_1_1Mat_html_a69ae0402d116fc9c71908d8508dc2f09"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09">cv::Mat::ones</a></div><div class="ttdeci">static MatExpr ones(int rows, int cols, int type)</div><div class="ttdoc">Returns an array of all 1&amp;#39;s of the specified size and type. </div></div>
<div class="ttc" id="features2d_8hpp_html"><div class="ttname"><a href="../../d5/d0d/features2d_8hpp.html">features2d.hpp</a></div></div>
<div class="ttc" id="group__core__basic_html_ga6395ca871a678020c4a31fadf7e8cc63"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">cv::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; _Tp &gt; Ptr</div><div class="ttdef"><b>Definition:</b> cvstd_wrapper.hpp:23</div></div>
<div class="ttc" id="group__imgproc__color__conversions_html_gga4e0972be5de079fed4e3a10e24ef5ef0a869da65c045477f2f17d39395df65b2d"><div class="ttname"><a href="../../d8/d01/group__imgproc__color__conversions.html#gga4e0972be5de079fed4e3a10e24ef5ef0a869da65c045477f2f17d39395df65b2d">cv::COLOR_GRAY2BGR</a></div><div class="ttdef"><b>Definition:</b> imgproc.hpp:553</div></div>
<div class="ttc" id="classcv_1_1Mat_html_a4d33bed1c850265370d2af0ff02e1564"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">cv::Mat::data</a></div><div class="ttdeci">uchar * data</div><div class="ttdoc">pointer to the data </div><div class="ttdef"><b>Definition:</b> mat.hpp:2098</div></div>
<div class="ttc" id="highgui_8hpp_html"><div class="ttname"><a href="../../d4/dd5/highgui_8hpp.html">highgui.hpp</a></div></div>
<div class="ttc" id="line__descriptor_8hpp_html"><div class="ttname"><a href="../../df/d4a/line__descriptor_8hpp.html">line_descriptor.hpp</a></div></div>
<div class="ttc" id="group__highgui_html_ga453d42fe4cb60e5723281a89973ee563"><div class="ttname"><a href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">cv::imshow</a></div><div class="ttdeci">void imshow(const String &amp;winname, InputArray mat)</div><div class="ttdoc">Displays an image in the specified window. </div></div>
<div class="ttc" id="structcv_1_1line__descriptor_1_1KeyLine_html_ac36c0fe32df87388d9fa6a8def75f7e4"><div class="ttname"><a href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#ac36c0fe32df87388d9fa6a8def75f7e4">cv::line_descriptor::KeyLine::startPointY</a></div><div class="ttdeci">float startPointY</div><div class="ttdef"><b>Definition:</b> descriptor.hpp:127</div></div>
<div class="ttc" id="namespacecv_html"><div class="ttname"><a href="../../d2/d75/namespacecv.html">cv</a></div><div class="ttdoc">&quot;black box&quot; representation of the file storage associated with a file on disk. </div><div class="ttdef"><b>Definition:</b> affine.hpp:51</div></div>
<div class="ttc" id="classcv_1_1CommandLineParser_html"><div class="ttname"><a href="../../d0/d2e/classcv_1_1CommandLineParser.html">cv::CommandLineParser</a></div><div class="ttdoc">Designed for command line parsing. </div><div class="ttdef"><b>Definition:</b> utility.hpp:799</div></div>
<div class="ttc" id="group__imgproc__color__conversions_html_ga397ae87e1288a81d2363b61574eb8cab"><div class="ttname"><a href="../../d8/d01/group__imgproc__color__conversions.html#ga397ae87e1288a81d2363b61574eb8cab">cv::cvtColor</a></div><div class="ttdeci">void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0)</div><div class="ttdoc">Converts an image from one color space to another. </div></div>
<div class="ttc" id="classcv_1_1Point___html"><div class="ttname"><a href="../../db/d4e/classcv_1_1Point__.html">cv::Point_&lt; int &gt;</a></div></div>
<div class="ttc" id="structcv_1_1line__descriptor_1_1KeyLine_html_acd62d95914b8005ee4f425c171c2ed1f"><div class="ttname"><a href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#acd62d95914b8005ee4f425c171c2ed1f">cv::line_descriptor::KeyLine::octave</a></div><div class="ttdeci">int octave</div><div class="ttdef"><b>Definition:</b> descriptor.hpp:112</div></div>
<div class="ttc" id="structcv_1_1line__descriptor_1_1KeyLine_html_a43b634f8f6b5953f2491b00bf6c231f6"><div class="ttname"><a href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#a43b634f8f6b5953f2491b00bf6c231f6">cv::line_descriptor::KeyLine::endPointX</a></div><div class="ttdeci">float endPointX</div><div class="ttdef"><b>Definition:</b> descriptor.hpp:128</div></div>
<div class="ttc" id="group__imgproc__draw_html_ga7078a9fae8c7e7d13d24dac2520ae4a2"><div class="ttname"><a href="../../d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2">cv::line</a></div><div class="ttdeci">void line(InputOutputArray img, Point pt1, Point pt2, const Scalar &amp;color, int thickness=1, int lineType=LINE_8, int shift=0)</div><div class="ttdoc">Draws a line segment connecting two points. </div></div>
<div class="ttc" id="group__core__basic_html_ga7d080aa40de011e4410bca63385ffe2a"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">cv::Point2f</a></div><div class="ttdeci">Point_&lt; float &gt; Point2f</div><div class="ttdef"><b>Definition:</b> types.hpp:192</div></div>
<div class="ttc" id="classcv_1_1Mat_html_a146f8e8dda07d1365a575ab83d9828d1"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a146f8e8dda07d1365a575ab83d9828d1">cv::Mat::size</a></div><div class="ttdeci">MatSize size</div><div class="ttdef"><b>Definition:</b> mat.hpp:2118</div></div>
<div class="ttc" id="utility_8hpp_html"><div class="ttname"><a href="../../d1/d4e/utility_8hpp.html">utility.hpp</a></div></div>
<div class="ttc" id="namespacecv_1_1line__descriptor_html"><div class="ttname"><a href="../../d2/d51/namespacecv_1_1line__descriptor.html">cv::line_descriptor</a></div><div class="ttdef"><b>Definition:</b> descriptor.hpp:74</div></div>
<div class="ttc" id="structcv_1_1line__descriptor_1_1KeyLine_html"><div class="ttname"><a href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html">cv::line_descriptor::KeyLine</a></div><div class="ttdoc">A class to represent a line. </div><div class="ttdef"><b>Definition:</b> descriptor.hpp:102</div></div>
<div class="ttc" id="imgproc_2include_2opencv2_2imgproc_8hpp_html"><div class="ttname"><a href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">imgproc.hpp</a></div></div>
<div class="ttc" id="group__core__basic_html_ga1f6634802eeadfd7245bc75cf3e216c2"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a></div><div class="ttdeci">std::string String</div><div class="ttdef"><b>Definition:</b> cvstd.hpp:150</div></div>
<div class="ttc" id="classcv_1_1Mat_html_adff2ea98da45eae0833e73582dd4a660"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#adff2ea98da45eae0833e73582dd4a660">cv::Mat::clone</a></div><div class="ttdeci">Mat clone() const CV_NODISCARD</div><div class="ttdoc">Creates a full copy of the array and the underlying data. </div></div>
<div class="ttc" id="group__core__hal__interface_html_ga81df635441b21f532fdace401e04f588"><div class="ttname"><a href="../../d1/d1b/group__core__hal__interface.html#ga81df635441b21f532fdace401e04f588">CV_8UC1</a></div><div class="ttdeci">#define CV_8UC1</div><div class="ttdef"><b>Definition:</b> interface.h:88</div></div>
<div class="ttc" id="classcv_1_1Mat_html"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a></div><div class="ttdoc">n-dimensional dense array class </div><div class="ttdef"><b>Definition:</b> mat.hpp:801</div></div>
<div class="ttc" id="classcv_1_1Mat_html_aa11336b9ac538e0475d840657ce164be"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#aa11336b9ac538e0475d840657ce164be">cv::Mat::channels</a></div><div class="ttdeci">int channels() const</div><div class="ttdoc">Returns the number of matrix channels. </div></div>
<div class="ttc" id="structcv_1_1line__descriptor_1_1KeyLine_html_a1b528bf3d1f3ab902e279ba1b5a593f1"><div class="ttname"><a href="../../d1/dd7/structcv_1_1line__descriptor_1_1KeyLine.html#a1b528bf3d1f3ab902e279ba1b5a593f1">cv::line_descriptor::KeyLine::endPointY</a></div><div class="ttdeci">float endPointY</div><div class="ttdef"><b>Definition:</b> descriptor.hpp:129</div></div>
<div class="ttc" id="group__highgui_html_ga5628525ad33f52eab17feebcfba38bd7"><div class="ttname"><a href="../../d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7">cv::waitKey</a></div><div class="ttdeci">int waitKey(int delay=0)</div><div class="ttdoc">Waits for a pressed key. </div></div>
</div><!-- fragment --><p>This is the result obtained for famous cameraman image:</p>
<div class="image">
<img src="../../lines_cameraman_edl.png" alt="lines_cameraman_edl.png"/>
<div class="caption">
alternate text</div></div>
<p> Another way to extract lines is using <em>LSDDetector</em> class; such class uses the LSD extractor to compute lines. To obtain this result, it is sufficient to use the snippet code seen above, just modifying it by the rows</p>
<div class="fragment"><div class="line"><span class="comment">// create a pointer to an LSDDetector object</span></div><div class="line">Ptr&lt;LSDDetector&gt; lsd = LSDDetector::createLSDDetector();</div><div class="line"></div><div class="line"><span class="comment">// compute lines</span></div><div class="line">std::vector&lt;KeyLine&gt; keylines;</div><div class="line">lsd-&gt;detect( imageMat, keylines, mask );</div></div><!-- fragment --><p>Here's the result returned by LSD detector again on cameraman picture:</p>
<div class="image">
<img src="../../cameraman_lines2.png" alt="cameraman_lines2.png"/>
<div class="caption">
alternate text</div></div>
<p> Once keylines have been detected, it is possible to compute their descriptors as shown in the following:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*M///////////////////////////////////////////////////////////////////////////////////////</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> //  By downloading, copying, installing or using the software you agree to this license.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> //  If you do not agree to this license, do not download, install,</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> //  copy or use the software.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> //                           License Agreement</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> //                For Open Source Computer Vision Library</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> // Copyright (C) 2014, Biagio Montesano, all rights reserved.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> // Third party copyrights are property of their respective owners.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> // Redistribution and use in source and binary forms, with or without modification,</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> // are permitted provided that the following conditions are met:</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> //   * Redistribution&#39;s of source code must retain the above copyright notice,</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> //     this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> //   * Redistribution&#39;s in binary form must reproduce the above copyright notice,</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> //     this list of conditions and the following disclaimer in the documentation</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> //     and/or other materials provided with the distribution.</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> //   * The name of the copyright holders may not be used to endorse or promote products</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> //     derived from this software without specific prior written permission.</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> // This software is provided by the copyright holders and contributors &quot;as is&quot; and</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> // any express or implied warranties, including, but not limited to, the implied</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"> // warranties of merchantability and fitness for a particular purpose are disclaimed.</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment"> // In no event shall the Intel Corporation or contributors be liable for any direct,</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"> // indirect, incidental, special, exemplary, or consequential damages</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment"> // (including, but not limited to, procurement of substitute goods or services;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment"> // loss of use, data, or profits; or business interruption) however caused</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment"> // and on any theory of liability, whether in contract, strict liability,</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment"> // or tort (including negligence or otherwise) arising in any way out of</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment"> // the use of this software, even if advised of the possibility of such damage.</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="comment"> //M*/</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;opencv2/opencv_modules.hpp&gt;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#ifdef HAVE_OPENCV_FEATURES2D</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../df/d4a/line__descriptor_8hpp.html">opencv2/line_descriptor.hpp</a>&gt;</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4e/utility_8hpp.html">opencv2/core/utility.hpp</a>&gt;</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d5/d0d/features2d_8hpp.html">opencv2/features2d.hpp</a>&gt;</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d4/dd5/highgui_8hpp.html">opencv2/highgui.hpp</a>&gt;</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword">using namespace </span><a class="code" href="../../d2/d51/namespacecv_1_1line__descriptor.html">cv::line_descriptor</a>;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* keys =</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;{ <span class="stringliteral">&quot;{@image_path | | Image path }&quot;</span> };</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> help()</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;{</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;\nThis example shows the functionalities of lines extraction &quot;</span> &lt;&lt; <span class="stringliteral">&quot;and descriptors computation furnished by BinaryDescriptor class\n&quot;</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;            &lt;&lt; <span class="stringliteral">&quot;Please, run this sample using a command in the form\n&quot;</span> &lt;&lt; <span class="stringliteral">&quot;./example_line_descriptor_compute_descriptors &lt;path_to_input_image&gt;&quot;</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;            &lt;&lt; std::endl;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="keywordtype">int</span> main( <span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv )</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;{</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <span class="comment">/* get parameters from command line */</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <a class="code" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> parser( argc, argv, keys );</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> image_path = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;( 0 );</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="keywordflow">if</span>( image_path.empty() )</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  {</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    help();</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  }</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <span class="comment">/* load image */</span></div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> imageMat = <a class="code" href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">imread</a>( image_path, 1 );</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <span class="keywordflow">if</span>( imageMat.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">data</a> == NULL )</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  {</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    std::cout &lt;&lt; <span class="stringliteral">&quot;Error, image could not be loaded. Please, check its path&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;  }</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;  <span class="comment">/* create a binary mask */</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> mask = <a class="code" href="../../d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09">Mat::ones</a>( imageMat.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a146f8e8dda07d1365a575ab83d9828d1">size</a>(), <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga81df635441b21f532fdace401e04f588">CV_8UC1</a> );</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="comment">/* create a pointer to a BinaryDescriptor object with default parameters */</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr&lt;BinaryDescriptor&gt;</a> bd = <a class="code" href="../../d6/d83/classcv_1_1line__descriptor_1_1BinaryDescriptor.html#ad896d4dfe36452cf01bd578f78d3062a">BinaryDescriptor::createBinaryDescriptor</a>();</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  <span class="comment">/* compute lines */</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  std::vector&lt;KeyLine&gt; keylines;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  bd-&gt;detect( imageMat, keylines, mask );</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  <span class="comment">/* compute descriptors */</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> descriptors;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  bd-&gt;compute( imageMat, keylines, descriptors);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;}</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="keywordtype">int</span> main()</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;{</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    std::cerr &lt;&lt; <span class="stringliteral">&quot;OpenCV was built without features2d module&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="preprocessor">#endif // HAVE_OPENCV_FEATURES2D</span></div><div class="ttc" id="classcv_1_1line__descriptor_1_1BinaryDescriptor_html_ad896d4dfe36452cf01bd578f78d3062a"><div class="ttname"><a href="../../d6/d83/classcv_1_1line__descriptor_1_1BinaryDescriptor.html#ad896d4dfe36452cf01bd578f78d3062a">cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor</a></div><div class="ttdeci">static Ptr&lt; BinaryDescriptor &gt; createBinaryDescriptor()</div><div class="ttdoc">Create a BinaryDescriptor object with default parameters (or with the ones provided) and return a sma...</div></div>
<div class="ttc" id="group__imgcodecs_html_ga288b8b3da0892bd651fce07b3bbd3a56"><div class="ttname"><a href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">cv::imread</a></div><div class="ttdeci">Mat imread(const String &amp;filename, int flags=IMREAD_COLOR)</div><div class="ttdoc">Loads an image from a file. </div></div>
<div class="ttc" id="classcv_1_1Mat_html_a69ae0402d116fc9c71908d8508dc2f09"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09">cv::Mat::ones</a></div><div class="ttdeci">static MatExpr ones(int rows, int cols, int type)</div><div class="ttdoc">Returns an array of all 1&amp;#39;s of the specified size and type. </div></div>
<div class="ttc" id="features2d_8hpp_html"><div class="ttname"><a href="../../d5/d0d/features2d_8hpp.html">features2d.hpp</a></div></div>
<div class="ttc" id="group__core__basic_html_ga6395ca871a678020c4a31fadf7e8cc63"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">cv::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; _Tp &gt; Ptr</div><div class="ttdef"><b>Definition:</b> cvstd_wrapper.hpp:23</div></div>
<div class="ttc" id="classcv_1_1Mat_html_a4d33bed1c850265370d2af0ff02e1564"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">cv::Mat::data</a></div><div class="ttdeci">uchar * data</div><div class="ttdoc">pointer to the data </div><div class="ttdef"><b>Definition:</b> mat.hpp:2098</div></div>
<div class="ttc" id="highgui_8hpp_html"><div class="ttname"><a href="../../d4/dd5/highgui_8hpp.html">highgui.hpp</a></div></div>
<div class="ttc" id="line__descriptor_8hpp_html"><div class="ttname"><a href="../../df/d4a/line__descriptor_8hpp.html">line_descriptor.hpp</a></div></div>
<div class="ttc" id="namespacecv_html"><div class="ttname"><a href="../../d2/d75/namespacecv.html">cv</a></div><div class="ttdoc">&quot;black box&quot; representation of the file storage associated with a file on disk. </div><div class="ttdef"><b>Definition:</b> affine.hpp:51</div></div>
<div class="ttc" id="classcv_1_1CommandLineParser_html"><div class="ttname"><a href="../../d0/d2e/classcv_1_1CommandLineParser.html">cv::CommandLineParser</a></div><div class="ttdoc">Designed for command line parsing. </div><div class="ttdef"><b>Definition:</b> utility.hpp:799</div></div>
<div class="ttc" id="classcv_1_1Mat_html_a146f8e8dda07d1365a575ab83d9828d1"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a146f8e8dda07d1365a575ab83d9828d1">cv::Mat::size</a></div><div class="ttdeci">MatSize size</div><div class="ttdef"><b>Definition:</b> mat.hpp:2118</div></div>
<div class="ttc" id="utility_8hpp_html"><div class="ttname"><a href="../../d1/d4e/utility_8hpp.html">utility.hpp</a></div></div>
<div class="ttc" id="namespacecv_1_1line__descriptor_html"><div class="ttname"><a href="../../d2/d51/namespacecv_1_1line__descriptor.html">cv::line_descriptor</a></div><div class="ttdef"><b>Definition:</b> descriptor.hpp:74</div></div>
<div class="ttc" id="imgproc_2include_2opencv2_2imgproc_8hpp_html"><div class="ttname"><a href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">imgproc.hpp</a></div></div>
<div class="ttc" id="group__core__basic_html_ga1f6634802eeadfd7245bc75cf3e216c2"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a></div><div class="ttdeci">std::string String</div><div class="ttdef"><b>Definition:</b> cvstd.hpp:150</div></div>
<div class="ttc" id="group__core__hal__interface_html_ga81df635441b21f532fdace401e04f588"><div class="ttname"><a href="../../d1/d1b/group__core__hal__interface.html#ga81df635441b21f532fdace401e04f588">CV_8UC1</a></div><div class="ttdeci">#define CV_8UC1</div><div class="ttdef"><b>Definition:</b> interface.h:88</div></div>
<div class="ttc" id="classcv_1_1Mat_html"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a></div><div class="ttdoc">n-dimensional dense array class </div><div class="ttdef"><b>Definition:</b> mat.hpp:801</div></div>
</div><!-- fragment --><h2>Matching among descriptors </h2>
<p>If we have extracted descriptors from two different images, it is possible to search for matches among them. One way of doing it is matching exactly a descriptor to each input query descriptor, choosing the one at closest distance:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*M///////////////////////////////////////////////////////////////////////////////////////</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> //  By downloading, copying, installing or using the software you agree to this license.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> //  If you do not agree to this license, do not download, install,</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> //  copy or use the software.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> //                           License Agreement</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> //                For Open Source Computer Vision Library</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> // Copyright (C) 2014, Biagio Montesano, all rights reserved.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> // Third party copyrights are property of their respective owners.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> // Redistribution and use in source and binary forms, with or without modification,</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> // are permitted provided that the following conditions are met:</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> //   * Redistribution&#39;s of source code must retain the above copyright notice,</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> //     this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> //   * Redistribution&#39;s in binary form must reproduce the above copyright notice,</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> //     this list of conditions and the following disclaimer in the documentation</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> //     and/or other materials provided with the distribution.</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> //   * The name of the copyright holders may not be used to endorse or promote products</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> //     derived from this software without specific prior written permission.</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> // This software is provided by the copyright holders and contributors &quot;as is&quot; and</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> // any express or implied warranties, including, but not limited to, the implied</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"> // warranties of merchantability and fitness for a particular purpose are disclaimed.</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment"> // In no event shall the Intel Corporation or contributors be liable for any direct,</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"> // indirect, incidental, special, exemplary, or consequential damages</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment"> // (including, but not limited to, procurement of substitute goods or services;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment"> // loss of use, data, or profits; or business interruption) however caused</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment"> // and on any theory of liability, whether in contract, strict liability,</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment"> // or tort (including negligence or otherwise) arising in any way out of</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment"> // the use of this software, even if advised of the possibility of such damage.</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="comment"> //M*/</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;opencv2/opencv_modules.hpp&gt;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#ifdef HAVE_OPENCV_FEATURES2D</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../df/d4a/line__descriptor_8hpp.html">opencv2/line_descriptor.hpp</a>&gt;</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4e/utility_8hpp.html">opencv2/core/utility.hpp</a>&gt;</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d5/d0d/features2d_8hpp.html">opencv2/features2d.hpp</a>&gt;</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d4/dd5/highgui_8hpp.html">opencv2/highgui.hpp</a>&gt;</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">#define MATCHES_DIST_THRESHOLD 25</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword">using namespace </span><a class="code" href="../../d2/d51/namespacecv_1_1line__descriptor.html">cv::line_descriptor</a>;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* keys =</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{ <span class="stringliteral">&quot;{@image_path1 | | Image path 1 }&quot;</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="stringliteral">&quot;{@image_path2 | | Image path 2 }&quot;</span> };</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> help()</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;{</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;\nThis example shows the functionalities of lines extraction &quot;</span> &lt;&lt; <span class="stringliteral">&quot;and descriptors computation furnished by BinaryDescriptor class\n&quot;</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;            &lt;&lt; <span class="stringliteral">&quot;Please, run this sample using a command in the form\n&quot;</span> &lt;&lt; <span class="stringliteral">&quot;./example_line_descriptor_compute_descriptors &lt;path_to_input_image 1&gt;&quot;</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;            &lt;&lt; <span class="stringliteral">&quot;&lt;path_to_input_image 2&gt;&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;}</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="keywordtype">int</span> main( <span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv )</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;{</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <span class="comment">/* get parameters from command line */</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <a class="code" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> parser( argc, argv, keys );</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> image_path1 = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;( 0 );</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> image_path2 = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;( 1 );</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="keywordflow">if</span>( image_path1.empty() || image_path2.empty() )</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  {</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    help();</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  }</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;  <span class="comment">/* load image */</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> imageMat1 = <a class="code" href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">imread</a>( image_path1, 1 );</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> imageMat2 = <a class="code" href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">imread</a>( image_path2, 1 );</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <span class="keywordflow">if</span>( imageMat1.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">data</a> == NULL || imageMat2.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">data</a> == NULL )</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;  {</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    std::cout &lt;&lt; <span class="stringliteral">&quot;Error, images could not be loaded. Please, check their path&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  }</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  <span class="comment">/* create binary masks */</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> mask1 = <a class="code" href="../../d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09">Mat::ones</a>( imageMat1.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a146f8e8dda07d1365a575ab83d9828d1">size</a>(), <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga81df635441b21f532fdace401e04f588">CV_8UC1</a> );</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> mask2 = <a class="code" href="../../d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09">Mat::ones</a>( imageMat2.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a146f8e8dda07d1365a575ab83d9828d1">size</a>(), <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga81df635441b21f532fdace401e04f588">CV_8UC1</a> );</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  <span class="comment">/* create a pointer to a BinaryDescriptor object with default parameters */</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr&lt;BinaryDescriptor&gt;</a> bd = <a class="code" href="../../d6/d83/classcv_1_1line__descriptor_1_1BinaryDescriptor.html#ad896d4dfe36452cf01bd578f78d3062a">BinaryDescriptor::createBinaryDescriptor</a>(  );</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  <span class="comment">/* compute lines and descriptors */</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  std::vector&lt;KeyLine&gt; keylines1, keylines2;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> descr1, descr2;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  ( *bd )( imageMat1, mask1, keylines1, descr1, <span class="keyword">false</span>, false );</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  ( *bd )( imageMat2, mask2, keylines2, descr2, <span class="keyword">false</span>, false );</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <span class="comment">/* select keylines from first octave and their descriptors */</span></div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  std::vector&lt;KeyLine&gt; lbd_octave1, lbd_octave2;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> left_lbd, right_lbd;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; (int) keylines1.size(); i++ )</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  {</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">if</span>( keylines1[i].octave == 0 )</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    {</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;      lbd_octave1.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">push_back</a>( keylines1[i] );</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;      left_lbd.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">push_back</a>( descr1.row( i ) );</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    }</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  }</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j = 0; j &lt; (int) keylines2.size(); j++ )</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;  {</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordflow">if</span>( keylines2[j].octave == 0 )</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    {</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;      lbd_octave2.push_back( keylines2[j] );</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;      right_lbd.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">push_back</a>( descr2.row( j ) );</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    }</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  }</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;  <span class="comment">/* create a BinaryDescriptorMatcher object */</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr&lt;BinaryDescriptorMatcher&gt;</a> bdm = <a class="code" href="../../d2/dde/classcv_1_1line__descriptor_1_1BinaryDescriptorMatcher.html#afd10bfe7d4ab8c952599745b088e9af2">BinaryDescriptorMatcher::createBinaryDescriptorMatcher</a>();</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  <span class="comment">/* require match */</span></div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  std::vector&lt;DMatch&gt; matches;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;  bdm-&gt;match( left_lbd, right_lbd, matches );</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  <span class="comment">/* select best matches */</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  std::vector&lt;DMatch&gt; good_matches;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; (int) matches.size(); i++ )</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;  {</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordflow">if</span>( matches[i].distance &lt; MATCHES_DIST_THRESHOLD )</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;      good_matches.push_back( matches[i] );</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;  }</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;  <span class="comment">/* plot matches */</span></div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> outImg;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> scaled1, scaled2;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;  std::vector&lt;char&gt; <a class="code" href="../../da/dd3/group__gapi__math.html#gaba076d51941328cb7ca9348b7b535220">mask</a>( matches.size(), 1 );</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;  <a class="code" href="../../dc/ddd/group__line__descriptor.html#ga01e43c974ddb735d39dd7124499f40ab">drawLineMatches</a>( imageMat1, lbd_octave1, imageMat2, lbd_octave2, good_matches, outImg, <a class="code" href="../../d1/da0/classcv_1_1Scalar__.html#ac1509a4b8454fe7fe29db069e13a2e6f">Scalar::all</a>( -1 ), <a class="code" href="../../d1/da0/classcv_1_1Scalar__.html#ac1509a4b8454fe7fe29db069e13a2e6f">Scalar::all</a>( -1 ), mask,</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                     <a class="code" href="../../d8/d6f/structcv_1_1line__descriptor_1_1DrawLinesMatchesFlags.html#a2396cadbfb2ca58057df921aa138f9b3a2e8e234416ae60a082f9078f3b4ff083">DrawLinesMatchesFlags::DEFAULT</a> );</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;  <a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">imshow</a>( <span class="stringliteral">&quot;Matches&quot;</span>, outImg );</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;  <a class="code" href="../../d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7">waitKey</a>();</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  <a class="code" href="../../d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce">imwrite</a>(<span class="stringliteral">&quot;/home/ubisum/Desktop/images/env_match/matches.jpg&quot;</span>, outImg);</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;  <span class="comment">/* create an LSD detector */</span></div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr&lt;LSDDetector&gt;</a> lsd = <a class="code" href="../../d1/dbd/classcv_1_1line__descriptor_1_1LSDDetector.html#a8de4c87977c2d3fa54b765df532cbf96">LSDDetector::createLSDDetector</a>();</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  <span class="comment">/* detect lines */</span></div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;  std::vector&lt;KeyLine&gt; klsd1, klsd2;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> lsd_descr1, lsd_descr2;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;  lsd-&gt;detect( imageMat1, klsd1, 2, 2, mask1 );</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;  lsd-&gt;detect( imageMat2, klsd2, 2, 2, mask2 );</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;  <span class="comment">/* compute descriptors for lines from first octave */</span></div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;  bd-&gt;compute( imageMat1, klsd1, lsd_descr1 );</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;  bd-&gt;compute( imageMat2, klsd2, lsd_descr2 );</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;  <span class="comment">/* select lines and descriptors from first octave */</span></div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;  std::vector&lt;KeyLine&gt; octave0_1, octave0_2;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> leftDEscr, rightDescr;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; (int) klsd1.size(); i++ )</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  {</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordflow">if</span>( klsd1[i].octave == 1 )</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    {</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;      octave0_1.push_back( klsd1[i] );</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      leftDEscr.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">push_back</a>( lsd_descr1.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a4b22e1c23af7a7f2eef8fa478cfa7434">row</a>( i ) );</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    }</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;  }</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j = 0; j &lt; (int) klsd2.size(); j++ )</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;  {</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keywordflow">if</span>( klsd2[j].octave == 1 )</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    {</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;      octave0_2.push_back( klsd2[j] );</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;      rightDescr.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">push_back</a>( lsd_descr2.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a4b22e1c23af7a7f2eef8fa478cfa7434">row</a>( j ) );</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    }</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;  }</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  <span class="comment">/* compute matches */</span></div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;  std::vector&lt;DMatch&gt; lsd_matches;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;  bdm-&gt;match( leftDEscr, rightDescr, lsd_matches );</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;  <span class="comment">/* select best matches */</span></div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;  good_matches.clear();</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; (int) lsd_matches.size(); i++ )</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;  {</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keywordflow">if</span>( lsd_matches[i].distance &lt; MATCHES_DIST_THRESHOLD )</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;      good_matches.push_back( lsd_matches[i] );</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;  }</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;  <span class="comment">/* plot matches */</span></div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a> lsd_outImg;</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;  <a class="code" href="../../da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d">resize</a>( imageMat1, imageMat1, <a class="code" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>( imageMat1.cols / 2, imageMat1.rows / 2 ), 0, 0, <a class="code" href="../../da/d54/group__imgproc__transform.html#gga5bb5a1fea74ea38e1a5445ca803ff121ac00f4a8155563cdc23437fc0959da935">INTER_LINEAR_EXACT</a> );</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;  <a class="code" href="../../da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d">resize</a>( imageMat2, imageMat2, <a class="code" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>( imageMat2.cols / 2, imageMat2.rows / 2 ), 0, 0, <a class="code" href="../../da/d54/group__imgproc__transform.html#gga5bb5a1fea74ea38e1a5445ca803ff121ac00f4a8155563cdc23437fc0959da935">INTER_LINEAR_EXACT</a> );</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;  std::vector&lt;char&gt; lsd_mask( matches.size(), 1 );</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;  <a class="code" href="../../dc/ddd/group__line__descriptor.html#ga01e43c974ddb735d39dd7124499f40ab">drawLineMatches</a>( imageMat1, octave0_1, imageMat2, octave0_2, good_matches, lsd_outImg, <a class="code" href="../../d1/da0/classcv_1_1Scalar__.html#ac1509a4b8454fe7fe29db069e13a2e6f">Scalar::all</a>( -1 ), <a class="code" href="../../d1/da0/classcv_1_1Scalar__.html#ac1509a4b8454fe7fe29db069e13a2e6f">Scalar::all</a>( -1 ), lsd_mask,</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;                   <a class="code" href="../../d8/d6f/structcv_1_1line__descriptor_1_1DrawLinesMatchesFlags.html#a2396cadbfb2ca58057df921aa138f9b3a2e8e234416ae60a082f9078f3b4ff083">DrawLinesMatchesFlags::DEFAULT</a> );</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;  <a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">imshow</a>( <span class="stringliteral">&quot;LSD matches&quot;</span>, lsd_outImg );</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;  <a class="code" href="../../d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7">waitKey</a>();</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;}</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;<span class="keywordtype">int</span> main()</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;{</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    std::cerr &lt;&lt; <span class="stringliteral">&quot;OpenCV was built without features2d module&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;}</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<span class="preprocessor">#endif // HAVE_OPENCV_FEATURES2D</span></div><div class="ttc" id="group__imgcodecs_html_gabbc7ef1aa2edfaa87772f1202d67e0ce"><div class="ttname"><a href="../../d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce">cv::imwrite</a></div><div class="ttdeci">bool imwrite(const String &amp;filename, InputArray img, const std::vector&lt; int &gt; &amp;params=std::vector&lt; int &gt;())</div><div class="ttdoc">Saves an image to a specified file. </div></div>
<div class="ttc" id="classcv_1_1line__descriptor_1_1LSDDetector_html_a8de4c87977c2d3fa54b765df532cbf96"><div class="ttname"><a href="../../d1/dbd/classcv_1_1line__descriptor_1_1LSDDetector.html#a8de4c87977c2d3fa54b765df532cbf96">cv::line_descriptor::LSDDetector::createLSDDetector</a></div><div class="ttdeci">static Ptr&lt; LSDDetector &gt; createLSDDetector()</div><div class="ttdoc">Creates ad LSDDetector object, using smart pointers. </div></div>
<div class="ttc" id="classcv_1_1line__descriptor_1_1BinaryDescriptor_html_ad896d4dfe36452cf01bd578f78d3062a"><div class="ttname"><a href="../../d6/d83/classcv_1_1line__descriptor_1_1BinaryDescriptor.html#ad896d4dfe36452cf01bd578f78d3062a">cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor</a></div><div class="ttdeci">static Ptr&lt; BinaryDescriptor &gt; createBinaryDescriptor()</div><div class="ttdoc">Create a BinaryDescriptor object with default parameters (or with the ones provided) and return a sma...</div></div>
<div class="ttc" id="classcv_1_1Mat_html_af4bd5c2cb936dd363816d867aab22a61"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">cv::Mat::push_back</a></div><div class="ttdeci">void push_back(const _Tp &amp;elem)</div><div class="ttdoc">Adds elements to the bottom of the matrix. </div></div>
<div class="ttc" id="group__imgcodecs_html_ga288b8b3da0892bd651fce07b3bbd3a56"><div class="ttname"><a href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">cv::imread</a></div><div class="ttdeci">Mat imread(const String &amp;filename, int flags=IMREAD_COLOR)</div><div class="ttdoc">Loads an image from a file. </div></div>
<div class="ttc" id="classcv_1_1Mat_html_a69ae0402d116fc9c71908d8508dc2f09"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09">cv::Mat::ones</a></div><div class="ttdeci">static MatExpr ones(int rows, int cols, int type)</div><div class="ttdoc">Returns an array of all 1&amp;#39;s of the specified size and type. </div></div>
<div class="ttc" id="features2d_8hpp_html"><div class="ttname"><a href="../../d5/d0d/features2d_8hpp.html">features2d.hpp</a></div></div>
<div class="ttc" id="group__core__basic_html_ga6395ca871a678020c4a31fadf7e8cc63"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">cv::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; _Tp &gt; Ptr</div><div class="ttdef"><b>Definition:</b> cvstd_wrapper.hpp:23</div></div>
<div class="ttc" id="classcv_1_1Mat_html_a4d33bed1c850265370d2af0ff02e1564"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">cv::Mat::data</a></div><div class="ttdeci">uchar * data</div><div class="ttdoc">pointer to the data </div><div class="ttdef"><b>Definition:</b> mat.hpp:2098</div></div>
<div class="ttc" id="highgui_8hpp_html"><div class="ttname"><a href="../../d4/dd5/highgui_8hpp.html">highgui.hpp</a></div></div>
<div class="ttc" id="line__descriptor_8hpp_html"><div class="ttname"><a href="../../df/d4a/line__descriptor_8hpp.html">line_descriptor.hpp</a></div></div>
<div class="ttc" id="group__highgui_html_ga453d42fe4cb60e5723281a89973ee563"><div class="ttname"><a href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">cv::imshow</a></div><div class="ttdeci">void imshow(const String &amp;winname, InputArray mat)</div><div class="ttdoc">Displays an image in the specified window. </div></div>
<div class="ttc" id="namespacecv_html"><div class="ttname"><a href="../../d2/d75/namespacecv.html">cv</a></div><div class="ttdoc">&quot;black box&quot; representation of the file storage associated with a file on disk. </div><div class="ttdef"><b>Definition:</b> affine.hpp:51</div></div>
<div class="ttc" id="group__imgproc__transform_html_ga47a974309e9102f5f08231edc7e7529d"><div class="ttname"><a href="../../da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d">cv::resize</a></div><div class="ttdeci">void resize(InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR)</div><div class="ttdoc">Resizes an image. </div></div>
<div class="ttc" id="classcv_1_1CommandLineParser_html"><div class="ttname"><a href="../../d0/d2e/classcv_1_1CommandLineParser.html">cv::CommandLineParser</a></div><div class="ttdoc">Designed for command line parsing. </div><div class="ttdef"><b>Definition:</b> utility.hpp:799</div></div>
<div class="ttc" id="structcv_1_1line__descriptor_1_1DrawLinesMatchesFlags_html_a2396cadbfb2ca58057df921aa138f9b3a2e8e234416ae60a082f9078f3b4ff083"><div class="ttname"><a href="../../d8/d6f/structcv_1_1line__descriptor_1_1DrawLinesMatchesFlags.html#a2396cadbfb2ca58057df921aa138f9b3a2e8e234416ae60a082f9078f3b4ff083">cv::line_descriptor::DrawLinesMatchesFlags::DEFAULT</a></div><div class="ttdef"><b>Definition:</b> descriptor.hpp:1157</div></div>
<div class="ttc" id="classcv_1_1Mat_html_a146f8e8dda07d1365a575ab83d9828d1"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a146f8e8dda07d1365a575ab83d9828d1">cv::Mat::size</a></div><div class="ttdeci">MatSize size</div><div class="ttdef"><b>Definition:</b> mat.hpp:2118</div></div>
<div class="ttc" id="utility_8hpp_html"><div class="ttname"><a href="../../d1/d4e/utility_8hpp.html">utility.hpp</a></div></div>
<div class="ttc" id="group__line__descriptor_html_ga01e43c974ddb735d39dd7124499f40ab"><div class="ttname"><a href="../../dc/ddd/group__line__descriptor.html#ga01e43c974ddb735d39dd7124499f40ab">cv::line_descriptor::drawLineMatches</a></div><div class="ttdeci">void drawLineMatches(const Mat &amp;img1, const std::vector&lt; KeyLine &gt; &amp;keylines1, const Mat &amp;img2, const std::vector&lt; KeyLine &gt; &amp;keylines2, const std::vector&lt; DMatch &gt; &amp;matches1to2, Mat &amp;outImg, const Scalar &amp;matchColor=Scalar::all(-1), const Scalar &amp;singleLineColor=Scalar::all(-1), const std::vector&lt; char &gt; &amp;matchesMask=std::vector&lt; char &gt;(), int flags=DrawLinesMatchesFlags::DEFAULT)</div><div class="ttdoc">Draws the found matches of keylines from two images. </div></div>
<div class="ttc" id="namespacecv_1_1line__descriptor_html"><div class="ttname"><a href="../../d2/d51/namespacecv_1_1line__descriptor.html">cv::line_descriptor</a></div><div class="ttdef"><b>Definition:</b> descriptor.hpp:74</div></div>
<div class="ttc" id="group__core__basic_html_ga346f563897249351a34549137c8532a0"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">cv::Size</a></div><div class="ttdeci">Size2i Size</div><div class="ttdef"><b>Definition:</b> types.hpp:347</div></div>
<div class="ttc" id="classcv_1_1Mat_html_a4b22e1c23af7a7f2eef8fa478cfa7434"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a4b22e1c23af7a7f2eef8fa478cfa7434">cv::Mat::row</a></div><div class="ttdeci">Mat row(int y) const</div><div class="ttdoc">Creates a matrix header for the specified matrix row. </div></div>
<div class="ttc" id="imgproc_2include_2opencv2_2imgproc_8hpp_html"><div class="ttname"><a href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">imgproc.hpp</a></div></div>
<div class="ttc" id="group__core__basic_html_ga1f6634802eeadfd7245bc75cf3e216c2"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a></div><div class="ttdeci">std::string String</div><div class="ttdef"><b>Definition:</b> cvstd.hpp:150</div></div>
<div class="ttc" id="group__core__hal__interface_html_ga81df635441b21f532fdace401e04f588"><div class="ttname"><a href="../../d1/d1b/group__core__hal__interface.html#ga81df635441b21f532fdace401e04f588">CV_8UC1</a></div><div class="ttdeci">#define CV_8UC1</div><div class="ttdef"><b>Definition:</b> interface.h:88</div></div>
<div class="ttc" id="classcv_1_1Scalar___html_ac1509a4b8454fe7fe29db069e13a2e6f"><div class="ttname"><a href="../../d1/da0/classcv_1_1Scalar__.html#ac1509a4b8454fe7fe29db069e13a2e6f">cv::Scalar_&lt; double &gt;::all</a></div><div class="ttdeci">static Scalar_&lt; double &gt; all(double v0)</div><div class="ttdoc">returns a scalar with all elements set to v0 </div></div>
<div class="ttc" id="classcv_1_1Mat_html"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a></div><div class="ttdoc">n-dimensional dense array class </div><div class="ttdef"><b>Definition:</b> mat.hpp:801</div></div>
<div class="ttc" id="classcv_1_1line__descriptor_1_1BinaryDescriptorMatcher_html_afd10bfe7d4ab8c952599745b088e9af2"><div class="ttname"><a href="../../d2/dde/classcv_1_1line__descriptor_1_1BinaryDescriptorMatcher.html#afd10bfe7d4ab8c952599745b088e9af2">cv::line_descriptor::BinaryDescriptorMatcher::createBinaryDescriptorMatcher</a></div><div class="ttdeci">static Ptr&lt; BinaryDescriptorMatcher &gt; createBinaryDescriptorMatcher()</div><div class="ttdoc">Create a BinaryDescriptorMatcher object and return a smart pointer to it. </div></div>
<div class="ttc" id="group__gapi__math_html_gaba076d51941328cb7ca9348b7b535220"><div class="ttname"><a href="../../da/dd3/group__gapi__math.html#gaba076d51941328cb7ca9348b7b535220">cv::gapi::mask</a></div><div class="ttdeci">GMat mask(const GMat &amp;src, const GMat &amp;mask)</div><div class="ttdoc">Applies a mask to a matrix. </div></div>
<div class="ttc" id="group__highgui_html_ga5628525ad33f52eab17feebcfba38bd7"><div class="ttname"><a href="../../d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7">cv::waitKey</a></div><div class="ttdeci">int waitKey(int delay=0)</div><div class="ttdoc">Waits for a pressed key. </div></div>
<div class="ttc" id="group__imgproc__transform_html_gga5bb5a1fea74ea38e1a5445ca803ff121ac00f4a8155563cdc23437fc0959da935"><div class="ttname"><a href="../../da/d54/group__imgproc__transform.html#gga5bb5a1fea74ea38e1a5445ca803ff121ac00f4a8155563cdc23437fc0959da935">cv::INTER_LINEAR_EXACT</a></div><div class="ttdef"><b>Definition:</b> imgproc.hpp:259</div></div>
</div><!-- fragment --><p>Sometimes, we could be interested in searching for the closest <em>k</em> descriptors, given an input one. This requires to modify slightly previous code:</p>
<div class="fragment"><div class="line"><span class="comment">// prepare a structure to host matches</span></div><div class="line">std::vector&lt;std::vector&lt;DMatch&gt; &gt; matches;</div><div class="line"></div><div class="line"><span class="comment">// require knn match</span></div><div class="line">bdm-&gt;knnMatch( descr1, descr2, matches, 6 );</div></div><!-- fragment --><p>In the above example, the closest 6 descriptors are returned for every query. In some cases, we could have a search radius and look for all descriptors distant at the most <em>r</em> from input query. Previous code must me modified:</p>
<div class="fragment"><div class="line"><span class="comment">// prepare a structure to host matches</span></div><div class="line">std::vector&lt;std::vector&lt;DMatch&gt; &gt; matches;</div><div class="line"></div><div class="line"><span class="comment">// compute matches</span></div><div class="line">bdm-&gt;radiusMatch( queries, matches, 30 );</div></div><!-- fragment --><p>Here's an example om matching among descriptors extratced from original cameraman image and its downsampled (and blurred) version:</p>
<div class="image">
<img src="../../matching2.png" alt="matching2.png"/>
<div class="caption">
alternate text</div></div>
 <h2>Querying internal database </h2>
<p>The <em>BynaryDescriptorMatcher</em> class, owns an internal database that can be populated with descriptors extracted from different images and queried using one of the modalities described in previous section. Population of internal dataset can be done using the <em>add</em> function; such function doesn't directly add new data to database, but it just stores it them locally. The real update happens when function <em>train</em> is invoked or when any querying function is executed, since each of them invokes <em>train</em> before querying. When queried, internal database not only returns required descriptors, but, for every returned match, it is able to tell which image matched descriptor was extracted from. An example of internal dataset usage is described in the following code; after adding locally new descriptors, a radius search is invoked. This provokes local data to be transferred to dataset, which, in turn, is then queried.</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*M///////////////////////////////////////////////////////////////////////////////////////</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> //  By downloading, copying, installing or using the software you agree to this license.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> //  If you do not agree to this license, do not download, install,</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> //  copy or use the software.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> //                           License Agreement</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> //                For Open Source Computer Vision Library</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> // Copyright (C) 2014, Biagio Montesano, all rights reserved.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> // Third party copyrights are property of their respective owners.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> // Redistribution and use in source and binary forms, with or without modification,</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> // are permitted provided that the following conditions are met:</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> //   * Redistribution&#39;s of source code must retain the above copyright notice,</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> //     this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> //   * Redistribution&#39;s in binary form must reproduce the above copyright notice,</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> //     this list of conditions and the following disclaimer in the documentation</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> //     and/or other materials provided with the distribution.</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> //   * The name of the copyright holders may not be used to endorse or promote products</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> //     derived from this software without specific prior written permission.</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> // This software is provided by the copyright holders and contributors &quot;as is&quot; and</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> // any express or implied warranties, including, but not limited to, the implied</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"> // warranties of merchantability and fitness for a particular purpose are disclaimed.</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment"> // In no event shall the Intel Corporation or contributors be liable for any direct,</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"> // indirect, incidental, special, exemplary, or consequential damages</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment"> // (including, but not limited to, procurement of substitute goods or services;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment"> // loss of use, data, or profits; or business interruption) however caused</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment"> // and on any theory of liability, whether in contract, strict liability,</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment"> // or tort (including negligence or otherwise) arising in any way out of</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment"> // the use of this software, even if advised of the possibility of such damage.</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment"> //</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="comment"> //M*/</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;opencv2/opencv_modules.hpp&gt;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#ifdef HAVE_OPENCV_FEATURES2D</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../df/d4a/line__descriptor_8hpp.html">opencv2/line_descriptor.hpp</a>&gt;</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4e/utility_8hpp.html">opencv2/core/utility.hpp</a>&gt;</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d5/d0d/features2d_8hpp.html">opencv2/features2d.hpp</a>&gt;</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="../../d4/dd5/highgui_8hpp.html">opencv2/highgui.hpp</a>&gt;</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword">using namespace </span><a class="code" href="../../d2/d51/namespacecv_1_1line__descriptor.html">cv::line_descriptor</a>;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> std::string images[] =</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{ <span class="stringliteral">&quot;cameraman.jpg&quot;</span>, <span class="stringliteral">&quot;church.jpg&quot;</span>, <span class="stringliteral">&quot;church2.png&quot;</span>, <span class="stringliteral">&quot;einstein.jpg&quot;</span>, <span class="stringliteral">&quot;stuff.jpg&quot;</span> };</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* keys =</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;{ <span class="stringliteral">&quot;{@image_path | | Image path }&quot;</span> };</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> help()</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;{</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;\nThis example shows the functionalities of radius matching &quot;</span> &lt;&lt; <span class="stringliteral">&quot;Please, run this sample using a command in the form\n&quot;</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;      &lt;&lt; <span class="stringliteral">&quot;./example_line_descriptor_radius_matching &lt;path_to_input_images&gt;/&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;}</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="keywordtype">int</span> main( <span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv )</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;{</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <span class="comment">/* get parameters from comand line */</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <a class="code" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> parser( argc, argv, keys );</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> pathToImages = parser.get &lt; <a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; ( 0 );</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  <span class="comment">/* create structures for hosting KeyLines and descriptors */</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="keywordtype">int</span> num_elements = <span class="keyword">sizeof</span> ( images ) / <span class="keyword">sizeof</span> ( images[0] );</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  std::vector &lt; Mat &gt; descriptorsMat;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  std::vector &lt; std::vector&lt;KeyLine&gt; &gt; linesMat;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <span class="comment">/*create a pointer to a BinaryDescriptor object */</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr &lt; BinaryDescriptor &gt;</a> bd = <a class="code" href="../../d6/d83/classcv_1_1line__descriptor_1_1BinaryDescriptor.html#ad896d4dfe36452cf01bd578f78d3062a">BinaryDescriptor::createBinaryDescriptor</a>();</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;  <span class="comment">/* compute lines and descriptors */</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; num_elements; i++ )</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;  {</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="comment">/* get path to image */</span></div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    std::stringstream image_path;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    image_path &lt;&lt; pathToImages &lt;&lt; images[i];</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    std::cout &lt;&lt; image_path.str().c_str() &lt;&lt; std::endl;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="comment">/* load image */</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> loadedImage = <a class="code" href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">imread</a>( image_path.str().c_str(), 1 );</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordflow">if</span>( loadedImage.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">data</a> == NULL )</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    {</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;      std::cout &lt;&lt; <span class="stringliteral">&quot;Could not load images.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;      help();</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;      exit( -1 );</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    }</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="comment">/* compute lines and descriptors */</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    std::vector &lt; KeyLine &gt; lines;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> computedDescr;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    bd-&gt;detect( loadedImage, lines );</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    bd-&gt;compute( loadedImage, lines, computedDescr );</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    descriptorsMat.push_back( computedDescr );</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    linesMat.push_back( lines );</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  }</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  <span class="comment">/* compose a queries matrix */</span></div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> queries;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">size_t</span> j = 0; j &lt; descriptorsMat.size(); j++ )</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;  {</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordflow">if</span>( descriptorsMat[j].rows &gt;= 5 )</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;      queries.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">push_back</a>( descriptorsMat[j].rowRange( 0, 5 ) );</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span>( descriptorsMat[j].rows &gt; 0 &amp;&amp; descriptorsMat[j].rows &lt; 5 )</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;      queries.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">push_back</a>( descriptorsMat[j] );</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  }</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;It has been generated a matrix of &quot;</span> &lt;&lt; queries.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#abed816466c45234254d25bc59c31245e">rows</a> &lt;&lt; <span class="stringliteral">&quot; descriptors&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  <span class="comment">/* create a BinaryDescriptorMatcher object */</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  <a class="code" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr &lt; BinaryDescriptorMatcher &gt;</a> bdm = <a class="code" href="../../d2/dde/classcv_1_1line__descriptor_1_1BinaryDescriptorMatcher.html#afd10bfe7d4ab8c952599745b088e9af2">BinaryDescriptorMatcher::createBinaryDescriptorMatcher</a>();</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  <span class="comment">/* populate matcher */</span></div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  bdm-&gt;add( descriptorsMat );</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="comment">/* compute matches */</span></div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;  std::vector &lt; std::vector&lt;DMatch&gt; &gt; matches;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;  bdm-&gt;radiusMatch( queries, matches, 30 );</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;size matches sample &quot;</span> &lt;&lt; matches.size() &lt;&lt; std::endl;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; (int) matches.size(); i++ )</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;  {</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j = 0; j &lt; (int) matches[i].<a class="code" href="../../df/d5b/namespacecv_1_1gapi_1_1streaming.html#a0a915e69f4cc8284293e40fc9ffbf157">size</a>(); j++ )</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    {</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;      std::cout &lt;&lt; <span class="stringliteral">&quot;match: &quot;</span> &lt;&lt; matches[i][j].queryIdx &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; matches[i][j].trainIdx &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; matches[i][j].distance &lt;&lt; std::endl;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    }</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  }</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;}</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="keywordtype">int</span> main()</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;{</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    std::cerr &lt;&lt; <span class="stringliteral">&quot;OpenCV was built without features2d module&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;}</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="preprocessor">#endif // HAVE_OPENCV_FEATURES2D</span></div><div class="ttc" id="classcv_1_1line__descriptor_1_1BinaryDescriptor_html_ad896d4dfe36452cf01bd578f78d3062a"><div class="ttname"><a href="../../d6/d83/classcv_1_1line__descriptor_1_1BinaryDescriptor.html#ad896d4dfe36452cf01bd578f78d3062a">cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor</a></div><div class="ttdeci">static Ptr&lt; BinaryDescriptor &gt; createBinaryDescriptor()</div><div class="ttdoc">Create a BinaryDescriptor object with default parameters (or with the ones provided) and return a sma...</div></div>
<div class="ttc" id="classcv_1_1Mat_html_abed816466c45234254d25bc59c31245e"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#abed816466c45234254d25bc59c31245e">cv::Mat::rows</a></div><div class="ttdeci">int rows</div><div class="ttdoc">the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions ...</div><div class="ttdef"><b>Definition:</b> mat.hpp:2096</div></div>
<div class="ttc" id="classcv_1_1Mat_html_af4bd5c2cb936dd363816d867aab22a61"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#af4bd5c2cb936dd363816d867aab22a61">cv::Mat::push_back</a></div><div class="ttdeci">void push_back(const _Tp &amp;elem)</div><div class="ttdoc">Adds elements to the bottom of the matrix. </div></div>
<div class="ttc" id="group__imgcodecs_html_ga288b8b3da0892bd651fce07b3bbd3a56"><div class="ttname"><a href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">cv::imread</a></div><div class="ttdeci">Mat imread(const String &amp;filename, int flags=IMREAD_COLOR)</div><div class="ttdoc">Loads an image from a file. </div></div>
<div class="ttc" id="features2d_8hpp_html"><div class="ttname"><a href="../../d5/d0d/features2d_8hpp.html">features2d.hpp</a></div></div>
<div class="ttc" id="group__core__basic_html_ga6395ca871a678020c4a31fadf7e8cc63"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">cv::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; _Tp &gt; Ptr</div><div class="ttdef"><b>Definition:</b> cvstd_wrapper.hpp:23</div></div>
<div class="ttc" id="classcv_1_1Mat_html_a4d33bed1c850265370d2af0ff02e1564"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564">cv::Mat::data</a></div><div class="ttdeci">uchar * data</div><div class="ttdoc">pointer to the data </div><div class="ttdef"><b>Definition:</b> mat.hpp:2098</div></div>
<div class="ttc" id="highgui_8hpp_html"><div class="ttname"><a href="../../d4/dd5/highgui_8hpp.html">highgui.hpp</a></div></div>
<div class="ttc" id="line__descriptor_8hpp_html"><div class="ttname"><a href="../../df/d4a/line__descriptor_8hpp.html">line_descriptor.hpp</a></div></div>
<div class="ttc" id="namespacecv_html"><div class="ttname"><a href="../../d2/d75/namespacecv.html">cv</a></div><div class="ttdoc">&quot;black box&quot; representation of the file storage associated with a file on disk. </div><div class="ttdef"><b>Definition:</b> affine.hpp:51</div></div>
<div class="ttc" id="classcv_1_1CommandLineParser_html"><div class="ttname"><a href="../../d0/d2e/classcv_1_1CommandLineParser.html">cv::CommandLineParser</a></div><div class="ttdoc">Designed for command line parsing. </div><div class="ttdef"><b>Definition:</b> utility.hpp:799</div></div>
<div class="ttc" id="utility_8hpp_html"><div class="ttname"><a href="../../d1/d4e/utility_8hpp.html">utility.hpp</a></div></div>
<div class="ttc" id="namespacecv_1_1line__descriptor_html"><div class="ttname"><a href="../../d2/d51/namespacecv_1_1line__descriptor.html">cv::line_descriptor</a></div><div class="ttdef"><b>Definition:</b> descriptor.hpp:74</div></div>
<div class="ttc" id="namespacecv_1_1gapi_1_1streaming_html_a0a915e69f4cc8284293e40fc9ffbf157"><div class="ttname"><a href="../../df/d5b/namespacecv_1_1gapi_1_1streaming.html#a0a915e69f4cc8284293e40fc9ffbf157">cv::gapi::streaming::size</a></div><div class="ttdeci">GOpaque&lt; Size &gt; size(const GMat &amp;src)</div><div class="ttdoc">Gets dimensions from Mat. </div></div>
<div class="ttc" id="imgproc_2include_2opencv2_2imgproc_8hpp_html"><div class="ttname"><a href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">imgproc.hpp</a></div></div>
<div class="ttc" id="group__core__basic_html_ga1f6634802eeadfd7245bc75cf3e216c2"><div class="ttname"><a href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a></div><div class="ttdeci">std::string String</div><div class="ttdef"><b>Definition:</b> cvstd.hpp:150</div></div>
<div class="ttc" id="classcv_1_1Mat_html"><div class="ttname"><a href="../../d3/d63/classcv_1_1Mat.html">cv::Mat</a></div><div class="ttdoc">n-dimensional dense array class </div><div class="ttdef"><b>Definition:</b> mat.hpp:801</div></div>
<div class="ttc" id="classcv_1_1line__descriptor_1_1BinaryDescriptorMatcher_html_afd10bfe7d4ab8c952599745b088e9af2"><div class="ttname"><a href="../../d2/dde/classcv_1_1line__descriptor_1_1BinaryDescriptorMatcher.html#afd10bfe7d4ab8c952599745b088e9af2">cv::line_descriptor::BinaryDescriptorMatcher::createBinaryDescriptorMatcher</a></div><div class="ttdeci">static Ptr&lt; BinaryDescriptorMatcher &gt; createBinaryDescriptorMatcher()</div><div class="ttdoc">Create a BinaryDescriptorMatcher object and return a smart pointer to it. </div></div>
</div><!-- fragment --> </div></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:39 for OpenCV by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
